import java.util.Scanner;

public class Password {
    public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);

        int count = 3;
        while(count != 0){
            System.out.print("请输入密码:");
            String password=scanner.nextLine();
            if(password.equals("123456")){
                System.out.print("登录成功");
                break;
            }
            else{
                count--;
                System.out.print("密码错误还有"+count+"次机会");
            }
        }
    }
}